<template>
  <div class="warpc">
    <!-- 个人详情页 -->
    <div class="bck">
      <img src="chenkong/imgs/bck/bjt.jpg" alt="" />
    </div>
    <div class="homepagecontent">
      <div class="headerbox">
        <div class="header">
          <p @click="fungo()"><van-icon name="arrow-left" /></p>
          <p><van-icon name="more-o" /></p>
        </div>
      </div>
      <!-- header个人头像头部 -->
      <div class="personlistbox">
        <div class="personlist">
          <div class="up">
            <div class="left">
              <img src="chenkong/imgs/bck/bjt.jpg" alt="" />
            </div>
            <div class="right">
              <h5>等风来_璟</h5>
              <p>ip属地：陕西省 <span class="iconfont icon-wenhao"></span></p>
            </div>
          </div>
          <div class="mid">本人有一个梦想：逛吃全世界</div>
          <div class="down">
            <div class="left">
              <div class="le">
                <h4>13</h4>
                <p>粉丝</p>
              </div>
              <div class="le">
                <h4>52</h4>
                <p>关注</p>
              </div>
              <div class="le">
                <h4>999</h4>
                <p>获赞</p>
              </div>
            </div>
            <div class="right">关注</div>
          </div>
        </div>
      </div>
      <!-- <footer>底部开始</footer> -->
      <div class="footerbox">
        <div class="footer">
          <!-- <div class="up">
          <p>动态</p>
          <p>笔记</p>
          <p>评价</p>
          <p>更多</p>
        </div> -->
          <van-tabs v-model="active">
            <van-tab title="动态">
              <div class="mid">
                <div class="all">
                  <p class="downo">全部.212</p>
                  <p class="mid">快食主义</p>
                  <p class="upo">武汉</p>
                  <p class="upp">美食</p>
                  <p class="upp">西餐</p>
                </div>
              </div>
              <!-- 图片mock -->
              <div class="down">
                <div class="playpic" v-for="(v, i) in objhome" :key="i + 1">
                  <div>
                    <img :src="v.img" alt />
                    <p class="ditu">
                      <span>
                        <span class="iconfont icon-ditu"></span>
                        {{ v.username }}</span
                      >
                      <span class="iconfont icon-dianzan">{{ v.num }}</span>
                    </p>
                    <p class="txt">{{ v.text }}</p>
                  </div>
                </div>
              </div>
            </van-tab>
            <van-tab title="笔记">内容 2</van-tab>
            <van-tab title="评价">内容 3</van-tab>
            <van-tab title="更多">内容 4</van-tab>
          </van-tabs>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  data() {
    return {
      arr: [],
      active: "",
      objhome: [],
    };
  },
  mounted() {
    axios.request("http://localhost:8889/Sperson").then((ok) => {
      console.log(ok);
      this.arr = ok.data;
    });
    axios.request("http://localhost:8889/ckhome").then(({ data }) => {
      this.objhome = data;
    });
  },
  methods: {
    fungo() {
      this.$router.go(-1);
    },
  },
  //   filters: {
  //     xiaoming(arr) {
  //       if (this.arr.length > 4) {
  //         this.arr.substr(0, 4);
  //       } else {
  //         return this.val;
  //       }
  //     },
  //   },
};
</script>

<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.warpc {
  position: relative;
}
.bck {
  top: -31.467vw;
  position: absolute;
  z-index: -999;
  img {
    width: 100%;
  }
}
::v-deep .van-tab {
  justify-content: flex-start;
  color: #181818;
  font-weight: bold;
}
::v-deep .van-tabs__line {
  height: 1.333vw;
  border-radius: 0%;
  bottom: 6.933vw;
  left: -5.867vw;

  background-image: linear-gradient(to right, #ed3828, #edac69);
}
.homepagecontent {
  background: #fff;
  margin-top: 18.667vw;
}
.headerbox {
  position: absolute;
  top: -11.733vw;
  width: 100%;
  .header {
    width: 91.733vw;
    margin: auto;
    display: flex;
    justify-content: space-between;
    font-size: 8vw;
    p {
      font-size: 5.6vw;
      // color: #fff;
    }
    .iconfont {
      font-size: 5.067vw;
      line-height: 10.667vw;
    }
  }
}
.personlistbox {
  width: 100%;
  .personlist {
    width: 91.733vw;
    height: 50.667vw;
    margin: auto;
    border-bottom: 0.08vw solid #f5f5f5;
    .up {
      width: 80vw;
      height: 22.133vw;
      display: flex;
      img {
        width: 22.667vw;
        height: 22.133vw;
        border-radius: 12.267vw;
      }
      .right {
        margin: 6.133vw 20.8vw 0 1.6vw;
        p {
          font-size: 2.667vw;
        }
        span {
          font-size: 2.667vw;
        }
      }
    }
    .mid {
      font-size: 2.667vw;
      margin-top: 6.4vw;
    }
    .down {
      background: #fff;
      display: flex;
      justify-content: space-between;
      .left {
        display: flex;
        justify-content: space-around;
        width: 26.667vw;
        height: 8.533vw;
        margin-top: 5.067vw;
        .le {
          text-align: center;
          p {
            font-size: 2.667vw;
            color: #707070;
          }
        }
      }
      .right {
        width: 54.133vw;
        height: 8vw;
        text-align: center;
        line-height: 8vw;
        background-color: #fa804f;
        margin-top: 5.6vw;
        color: white;
        border-radius: 4.8vw;
      }
    }
  }
}
.footerbox {
  background: #f5f5f5;
  width: 100%;
  margin-top: 4.267vw;
  .footer {
    width: 91.733vw;
    margin: auto;
    .up {
      width: 50.933vw;
      display: flex;
      justify-content: space-around;
      font-size: 3.733vw;
      font-weight: bold;
    }
  }
}
.mid {
  width: 100%;
  .all {
    margin: auto;
    width: 91.733vw;
    display: flex;
    text-align: center;
    line-height: 7.2vw;
    margin-top: 2.4vw;
    font-size: 2.4vw;
    .upo {
      width: 13.333vw;
      height: 7.2vw;
      border-radius: 2.667vw;
      margin-right: 1.333vw;
      background-color: #f6f6f6;
    }
    .upp {
      width: 13.333vw;
      height: 7.2vw;
      border-radius: 2.667vw;
      background-color: #f6f6f6;
      // color: #f68f7e;
      margin-right: 1.333vw;
    }
    .mid {
      width: 25.6vw;
      height: 7.2vw;
      border-radius: 2.667vw;
      background-color: #f6f6f6;
      margin-right: 1.333vw;
    }
    .downo {
      width: 20.267vw;
      height: 7.2vw;
      border-radius: 2.667vw;
      background-color: #ffeee7;
      color: #f68f7e;
    }
  }
}
.down {
  width: 100%;
  margin-top: 5.6vw;
  flex-wrap: wrap;
  display: flex;
  .playpic {
    margin: auto;
    padding-right: 0.8vw;
    margin-bottom: 1.333vw;
    // width: 91.733vw;
    // display: flex;
    // flex-wrap: wrap;
    background: #fff;

    // justify-content: space-between;
    div {
      width: 42.467vw;
      // height: 64.8vw;
      position: relative;
      .ditu {
        width: 100%;
        position: absolute;
        top: 40.533vw;
        left: 1.867vw;
        color: #f6f6f6;
        display: flex;
        justify-content: space-between;
        font-size: 2.667vw;
      }
      img {
        width: 41.467vw;
        height: 47.2vw;
      }
      .txt {
        // width: 42.467vw;

        font-size: 3.733vw;
        // line-height: 5.333vw;
        word-break: break-all;

        text-overflow: ellipsis;

        display: -webkit-box;

        -webkit-box-orient: vertical;

        -webkit-line-clamp: 2; /* 这里是超出几行省略 */

        overflow: hidden;

        width: 46.667vw;
        margin-bottom: 0.8vw;
        text-align: left;
        // overflow-wrap:warp;
      }
    }
  }
}
</style>